forum

home / developersection / forums / javascript - get portion of url path

JavaScript - Get Portion of URL Path

Royce Roy 3328 12-Mar-2013

Hi Everyone!

What is the correct way to pull out just the path from a URL using JavaScript?

Example:
I have URL
http://www.somedomain.com/account/search?filter=a#top
but I would just like to get this portion
/account/search

I am using jQuery if there is anything there that can be leveraged.

Thanks in advance


Updated on 12-Mar-2013
Royce Roy

Other


Message
Can you answer this question?

Answer

1 Answers

Liked By